﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using DaisleyHarrison.Wavefront;
using System.Windows.Media.Media3D;
using System.Windows.Media;

namespace UnitTest
{
    /// <summary>
    /// Summary description for UnitTest1
    /// </summary>
    [TestClass]
    public class UnitTest1
    {
        public UnitTest1()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test 
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        [TestMethod]
        public void TestMethod1()
        {
            ObjectLibrary objectLibrary = new ObjectLibrary();
            objectLibrary.Read("..\\..\\..\\UnitTest\\panel.obj");
        }
        [TestMethod]
        public void TestMethod2()
        {
            ObjectLibrary objectLibrary = new ObjectLibrary();
            objectLibrary.Read("..\\..\\..\\UnitTest\\panel.obj");
            foreach (MaterialLibrary materialLibrary in objectLibrary.MaterialLibraries)
            {
                foreach (DefinedMaterial definedMaterial in materialLibrary.Materials.Values)
                {
                    definedMaterial.BuildMaterial();
                }
            }
        }
        [TestMethod]
        public void TestMethod3()
        {
            ObjectLibrary objectLibrary = new ObjectLibrary();
            objectLibrary.Read("..\\..\\..\\UnitTest\\panel.obj");
            ModelVisual3D visual = objectLibrary.BuildVisual();
            string xaml = SerializationHelper.Serialize(visual);
        }
        [TestMethod]
        public void TestMethod4()
        {
            ObjectLibrary objectLibrary = new ObjectLibrary();
            objectLibrary.Read("..\\..\\..\\UnitTest\\cesna.obj");
        }
        [TestMethod]
        public void TestMethod5()
        {
            ObjectLibrary objectLibrary = new ObjectLibrary();
            objectLibrary.Read("..\\..\\..\\UnitTest\\humanoid_tri.obj");
        }
        [TestMethod]
        public void TestMethod6()
        {
            ObjectLibrary objectLibrary = new ObjectLibrary();
            objectLibrary.Read("..\\..\\..\\UnitTest\\teapot.obj");
        }
        [TestMethod]
        public void TestMethod7()
        {
            ObjectLibrary objectLibrary = new ObjectLibrary();
            objectLibrary.Read("..\\..\\..\\UnitTest\\roi.obj");
        }
        [TestMethod]
        public void TestMethod8()
        {
            double r = Colors.Silver.ScR;
            double g = Colors.Silver.ScG;
            double b = Colors.Silver.ScB;
            double r1 = Colors.Black.ScR;
            double g1 = Colors.Black.ScG;
            double b1 = Colors.Black.ScB;
            ObjectLibrary objectLibrary = new ObjectLibrary();
            objectLibrary.Read("..\\..\\..\\UnitTest\\violin_case.obj");
        }
    }
}
